from django import forms
from .models import Comment
class EmailPostForm(forms.Form):
    name = forms.CharField(max_length=25)
    email = forms.EmailField()
    to = forms.EmailField()
    comments = forms.CharField(required=False,
 widget=forms.Textarea)
class CommentForm(forms.ModelForm):
    class Meta:
 # 声明此表单是基于Comment数据模型类生成的
        model = Comment
 # 生成此表单有三个字段，分别是name，email，body
        fields = ('name', 'email', 'body')
class SearchForm(forms.Form):
       query = forms.CharField()
